home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / SETCHAR.H < prev    next >
Text File  |  1988-05-30  |  1KB  |  51 lines

  1. /* -*-C-*- setchar.h */
  2. /*-->setchar*/
  3. /**********************************************************************/
  4. /****************************** setchar *******************************/
  5. /**********************************************************************/
  6.  
  7. void
  8. setchar(c, update_h)
  9. register BYTE c;
  10. register BOOLEAN update_h;
  11. {
  12.     register struct char_entry *tcharptr;  /* temporary char_entry pointer */
  13.  
  14.     if (DBGOPT(DBG_SET_TEXT))
  15.     {
  16.     (void)fprintf(stderr,"setchar('");
  17.     if (isprint(c))
  18.         (void)putc(c,stderr);
  19.     else
  20.         (void)fprintf(stderr,"\\%03o",(int)c);
  21.     (void)fprintf(stderr,"'<%d>) (hh,vv) = (%ld,%ld) font name <%s>",
  22.         (int)c, (long)hh, (long)vv, fontptr->n);
  23.     NEWLINE(stderr);
  24.     }
  25.  
  26.     tcharptr = &(fontptr->ch[c]);
  27.     if (((hh - tcharptr->xoffp + tcharptr->pxlw) <= XSIZE)
  28.     && (hh >= 0)
  29.     && (vv <= YSIZE)
  30.     && (vv >= 0))
  31.     {                /* character fits entirely on page */
  32.     moveto( hh, (COORDINATE)(YSIZE-vv));
  33.     dispchar(c);
  34.     }
  35.     else if (DBGOPT(DBG_OFF_PAGE) && !quiet)
  36.     {                /* character is off page -- discard it */
  37.     (void)fprintf(stderr,
  38.         "setchar(): Char %c [10#%3d 8#%03o 16#%02x] off page.",
  39.         isprint(c) ? c : '?',c,c,c);
  40.     NEWLINE(stderr);
  41.     }
  42.  
  43.     if (update_h)
  44.     {
  45.     h += (INT32)tcharptr->tfmw;
  46.     hh += (COORDINATE)tcharptr->pxlw;
  47.     hh = (COORDINATE)(fixpos(hh-lmargin,h,conv) + lmargin);
  48.     }
  49. }
  50.  
  51.